Welcome to your PHP Practice Test 4. This test can be taken unlimited times. Signed in users can have their scores saved to be viewed later. Questions will be randomly displaying each test. Good luck! 1. Which function is used to check if the variable is a number or not? number() is_number() numeric() is_numeric()2. How do you destroy a cookie in PHP? Use the destroy() function Set the cookie expiration date in the past Use the remove_cookie() function Use the unset_session()3. Parse error in PHP - unexpected T_variable at line X' mean? A fatal error occurred at line X Need a try-catch block before line X You missed a semicolon at line X You missed a semicolon just before the line X4. What will be the result of the following expression?1===1.0 False True Error Nothing5. Which of the following function is used to get the time a file was accessed? filetime() filectime() fileatime() filelatime()6. Just like errors in PHP, you can also handle errors using try-catch blocks. True False7. Which of the following is the correct syntax of foreach loop? foreach (array => value) foreach (array array_variable => value) foreach (array as value) foreach (array as key)8. How do you concatenate two strings in PHP? By using the semicolon By using the dot operator By using the plus operator By using the dash operator 9. What is the output of the following code in PHP?$pass = 0;echo ('password' == $pass) ? 'true' : 'false'; False True Error Password10. What is the output of the following code in PHP?<?php$primes = array(1 => 'one', 2 => 'two', 3 => 'three', 5 => 'five', 7 => 'seven');echo $primes[4]?> Four Nothing will be display An error Five11. Which function is used to match alphabetic characters in PHP? ereg_match() ereg_replace() eregi_match() eregi_replace()12. Which of the following character is used to access property on an object-by-object basis? => -> :> _>13. $GLOBALS is an associative array containing all the variables defined in the global scope. True False14. What will be the output of the following code?<?php$A = new stdClass();$A->member = "John";$B = clone $A;var_dump($A === $B);?> bool(true) An error bool(False) None of the above.15. How many data types in PHP are classified as special types? 2 – Resources, Null 3 – Object, Resources, Null Only 1 – Resources 4 – Array, Resources, Object, Null16. Which directive needs to be changed to increase the size of the files to be uploaded? upload_max_size upload_max_file_size upload_max_filesize upload_max_file17. Which function is used to remove the HTML tags from the text? strip_tags() strip_Html() strip_htags() strip()18. What will be the output of the following code?$x=-1; if ($x)echo "hi " ;echo "how are u"; hi hi how are u how are u An error19. Which function is used to check if the variable is empty or not? isempty() empty() is_empty() var_empty()20. Which of the following function is used to read a complete file’s content into an array? file() arrfile() arrayfile() file_arr()Please fill in the comment box below.
Comments